package iofile;


import java.io.*;

//演示文件拷贝
//Buffered字符处理流
public class BufferedCopy_ {
    public static void main(String[] args) {

        String srcFile = "";
        String destFile = "";
        BufferedReader bufferedReader = null;
        BufferedWriter bufferedWriter = null;

        try {
            bufferedReader = new BufferedReader(new FileReader(srcFile));
            bufferedWriter = new BufferedWriter(new FileWriter(destFile));
            String line;
            while ((line = bufferedReader.readLine()) != null){
                bufferedWriter.write(line);
                //文件读入时，不会读入换行符，需要手动插入
                bufferedWriter.newLine();
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            try {
                bufferedReader.close();
                bufferedWriter.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

    }
}
